<!--
 * @Author: TaoLer <alipay_tao@qq.com>
 * @Date: 2021-12-06 16:04:51
 * @LastEditTime: 2022-07-30 07:08:19
 * @LastEditors: TaoLer
 * @Description: 搜索引擎SEO优化设置
 * @FilePath: \github\TaoLer\view\taoler\index\public\user.html
 * Copyright (c) 2020~2022 https://www.aieok.com All rights reserved.
-->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>用户中心</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="keywords" content="TaoLer社区">
	<meta name="description" content="TaoLer社区是模块化前端UI框架社区，致力于为web开发提供强劲动力">
	<link rel="stylesheet" href="{$Request.domain}/static/tpl/taoler/css/font_24081_qs69ykjbea.css" />
	<link rel="stylesheet" href="{$Request.domain}/static/component/layui/css/layui.css">
	<link rel="stylesheet" href="{$Request.domain}/static/tpl/taoler/css/global.css">
	{block name="css"}{/block}
	<script src="/static/component/layui/layui.js" charset="utf-8"></script>
	<script src="/static/component/pear/pear.js"></script>
	<script src="/static/common/notify.js"></script>
</head>
<body>
{include file="public/header" /}
<div class="layui-container fly-marginTop fly-user-main">
{include file="public/user-nav" /}
	<div class="fly-panel" pad20 style="padding-top:10px;">
	{block name="content"}{/block}	
	</div>
</div> 
{include file="public/footer" /}
<script>
    var 
	articleUrl    = "{:url('user/article')}";
	artListUrl    = "{:url('user/article')}",
	collListUrl   = "{:url('user/mycoll')}",
    atrDelUrl     = "{:url('article/delete')}",
    artEditUrl    = "{:url('article/edit')}",
    collDelUrl    = "{:url('user/colltDel')}",
    uploadHeadImg = "{:url('User/uploadHeadImg')}";
      
  	layui.cache.page = 'user';
    layui.cache.user = {
        username: "{$user.name ??'游客'}"
        ,uid: "{$user.id ?? -1}"
        ,avatar: "{$user['user_img'] ?? '/static/tpl/taoler/images/avatar/00.jpg'}"
        ,experience: "{$user.point ?? ''}"
        ,sex: "{$user.sex ? '女':'男'}"
    };
    
    layui.config({
        version: "3.0.0"
        ,base: '/static/tpl/taoler/mods/'
    }).extend({
        fly: 'index'
    }).use('fly',function(){
      var $ = layui.jquery;
      var notify = layui.notify;
      var element = layui.element;

		$.get("{:url('login_status')}", function(res) {
			if(res.code === 0) {
				var LOGHTML = `<li class="layui-nav-item"><a class="layui-icon layui-icon-username" style="font-size: 20px;" href="{:url('user_login')}"></a></li>
				<li class="layui-nav-item layui-hide-xs"><a href="{:url('user_login')}">{:lang('login')}</a></li>
				<li class="layui-nav-item layui-hide-xs"><a href="{:url('user_reg')}">{:lang('register')}</a></li>
				<li class="layui-nav-item layui-hide-xs layui-hide">
					<select name="language" style="width:50px;" lay-filter="language" lay-verify="" id="language">
						<option value="cn" {if cookie('think_lang') == 'zh-cn'} selected {/if} >{:lang('chinese')}</option>
						<option value="tw" {if cookie('think_lang') == 'zh-tw'} selected {/if} >{:lang('tChinese')}</option>
						<option value="en" {if cookie('think_lang') == 'en-us'} selected {/if} >{:lang('english')}</option>
					</select>
				</li>`;
			} else {
				var LOGHTML = `{if ($Request.action=='user')}
				<li class="layui-nav-item"><a href="/">{:lang('home page')}</a></li>
				{/if}
				<li class="layui-nav-item">
					<a class="fly-nav-avatar"><cite class="layui-hide-xs">${res.data.name}</cite><img src="${res.data.avatar}"></a>
					<dl class="layui-nav-child">
					<dd><a href="{:url('user/index')}"><i class="layui-icon layui-icon-username"></i>{:lang('user center')}</a></dd>
					<dd><a href="{:url('user/set')}"><i class="layui-icon layui-icon-set"></i>{:lang('set info')}</a></dd>
					<dd><a href="{:url('user/message')}"><i class="iconfont icon-tongzhi"></i>{:lang('my message')}</a></dd>
					<dd><a href="${res.data.user_home}"><i class="layui-icon layui-icon-home"></i>{:lang('my page')}</a></dd>
					<dd><a data-url="{:url('user/logout')}" href="javascript:void(0)" id="logout" style="text-align: center;">{:lang('logout')}</a></dd>
					</dl>
				</li>`;
			}

			$('.fly-nav-user').append(LOGHTML);
			$('.layui-nav-bar').remove();

        	element.render('nav', 'header-filter-nav');
      	})
    });

</script>
{block name="script"}
{/block}
</body>
</html>